<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-品牌列表">
</@frame.head>
<style>
 .trs td{text-align:center;}
</style>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 后台管理中心 <span class="c-gray en">&gt;</span> 商品品牌管理  <span class="c-gray en">&gt;</span> 品牌列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container"> 
  <form method="get" name="query_brand_form"  id="query_brand_form" action="${contextPath}/brand_specs/add_brand_specs_list" >    
  <input type="hidden" name="page" value="${pagination.pageNo}"  id="page" />  
  	 <input type="hidden" id="proId" name="proId"  value="${proId}"/>    
  	 <input type="hidden" id="brandIds" name="brandIds" value="${brandIds}"/>                  
  <div class="text-c">
       <table class="table">
          <tr>  
           <td  width="60px">品牌名称：</td>
           <td  width="150px">
           <input type="text" class="input-text radius"  placeholder="请输入品牌名称" value="${brandQo.name}" id="name" name="name"/>
           </td>   
           <td><input class="btn btn-success radius" type="button" onclick="search();"  value="搜索" /></td>  
         </tr>
      </table>
    </div>
  </form>
    <div class="cl pd-5 bg-1 bk-gray mt-20"> 
    <span class="l">
    <a href="javascript:;" onclick="addBrands();" class="btn btn-primary radius">确定添加</a> 
    </span>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr>
            <th scope="col" colspan="4">品牌列表</th>
        </tr>
        <tr  class="text-c">
            <th ><input  type="checkbox" id="selectAll"/> </th>
            <th >序号</th>
            <th >品牌名称</th>
        </tr>
        </thead>
        <tbody>
          <#list pagination.list as brand> 
             <tr  class="text-c">
                <td>
                <#if ishave_map_brands["${brand.id}"]??>
                <span class="label label-success radius">已添加</span>
                <#else> 
	            <input type='checkbox' onclick="ckClicked(this);" id='chk_${brand.id?c}' name='chk' value='${brand.id?c}'/>
                </#if>
                </td>
                <td>${brand.id?c}</td>
                <td>${brand.name}</td>
            </tr>
        </#list>
        </tbody>
    </table>
    <div id="div_page" style="padding-top: 10px;float: right"></div>
</div>
</div>
<@frame.end "default">
</@frame.end>
</html>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/brand/add_brand_specs_list.js"></script>
<script type="text/javascript">
var path="${contextPath}";
laypage({
    cont: 'div_page',//容器。值支持id名、原生dom对象，jquery对象。
    pages: ${pagination.totalPage},//通过后台拿到的总页数
    curr:  ${pagination.pageNo} || 1, //当前页
	skip: true, //是否开启跳页
	first: 1, //将首页显示为数字1,。若不显示，设置false即可
	last: ${pagination.totalPage}, //将尾页显示为总页数。若不显示，设置false即可
    jump: function(obj , first){//触发分页后的回调
        if(!first){ //点击跳页触发函数;当前页为obj.curr
        	setSelectedId();
            $("#page").val(obj.curr);
        	$("#query_brand_form").submit();
        }
    }
})  
</script>